<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var student = {
            //对象的属性
            id: 001,
            username: "张三",
            age: 18,
            address: "昆明",
            //对象的函数
            eat: function () {
                alert("干饭");
            },
            sleep: function () {
                alert("睡觉")
            }
        }


        //获取对象属性
        console.log(student.address);
        student.age = 9999;
        console.log(student);

        student.eat();

        /*
        自定义对象
        var 变量={
            属性名:属性值，
            ....,
            函数名:function(){}
        }

        调用属性
        对象名.属性
        对象名.属性=值

       调用属性函数
        对象名.函数名()
        
        
        */




    </script>
</head>

<body>

</body>

</html>